<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div style="width: 500px;height:800px;background-color: #ccc;margin: 50px auto;overflow: hidden;">

        <header style="width:500px;height:300px;position: fixed">
            <div style="width:500px;height:300px;position: relative;z-index: 200px;">
                <div style="width:500px;height:50px;position: absolute;bottom:0;left:0;background-color: #eee;">
                    这是标题
                </div>
            </div>
        </header>
        <footer style="width: 100%;height:500px;padding-top:300px;background-color: #0cf;overflow-y: scroll">
            <div style="width: 200px;height:500px;float: left;">
                <li> aaaaaa </li>
                <li> aaaaaa </li>
                <li> aaaaaa </li>
                <li> aaaaaa </li>
                <li> aaaaaa </li>
                <li> aaaaaa </li>
                <li> aaaaaa </li>
                <li> aaaaaa </li>
                <li> aaaaaa </li>
                <li> aaaaaa </li>
                <li> aaaaaa </li>
                <li> aaaaaa </li>
                <li> aaaaaa </li>
                <li> aaaaaa </li>
                <li> aaaaaa </li>
                <li> aaaaaa </li>
            </div>
            <div
                style="width: 280px;float: left;background-color: #c0f;float: left;margin-top: -300px;overflow-x: scroll">
                <div style="width: 500px;height:800px;float: left;background-color: #c0f;float: left;margin-top: 0px;">
                    <div style="height:300px;">
                        <li style="width: 50px;height:50px;float:left;">这是头部</li>
                        <li style="width: 50px;height:50px;float:left;">这是头部</li>
                        <li style="width: 50px;height:50px;float:left;">这是头部</li>
                        <li style="width: 50px;height:50px;float:left;">这是头部</li>
                        <li style="width: 50px;height:50px;float:left;">这是头部</li>
                        <li style="width: 50px;height:50px;float:left;">这是头部</li>
                        <li style="width: 50px;height:50px;float:left;">这是头部</li>
                    </div>
                    <div>
                        <li>这是其他部分</li>
                    </div>
                </div>
            </div>
        </footer>
    </div>
</body>

<script>

    var arr = [{
        name: '张三',
        status: '0',
        sub: [{
            name: '张三1',
            status: '0'
        }]
    }, {
        name: '历史',
        status: '0',
        sub: [{
            name: '历史1',
            status: '1'
        }, {
            name: '历史2',
            status: '0'
        }]
    }, {
        name: '王王',
        status: '0',
        sub: [{
            name: '王王1',
            status: '2'
        }]
    },
    ]


    let flag = false
    for (let i = 0; i < arr.length; i++) {
        const item = arr[i];
        let idx;
        for (let j = 0; j < item.sub.length; j++) {
            const element = item.sub[j];
            // console.log(element)
            // console.log('=================')
            if (element.status == '1') {
                console.log(element)

                idx = j
                flag = true
                console.log(idx)
            }else{
                continue;
            }
            if (true) {
                item.sub.splice(idx, 1)
            }
        }

    }
    console.log(arr)
</script>

</html>